<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>网页浏览 - DNF福利盒子</title>
    <script src="https://cdn.tailwindcss.com"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background: #f2f2f7;
            margin: 0;
            padding: 0;
            height: 100vh;
            overflow: hidden;
        }
        .status-bar {
            height: 44px;
            background: rgba(0, 0, 0, 0.8);
            color: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 20px;
            font-size: 14px;
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            z-index: 1000;
        }
        .nav-bar {
            height: 44px;
            background: white;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 0 16px;
            border-bottom: 1px solid #e5e5ea;
            position: fixed;
            top: 44px;
            left: 0;
            right: 0;
            z-index: 1000;
        }
        .nav-title {
            font-size: 16px;
            font-weight: 600;
            color: #1d1d1f;
            max-width: 200px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .nav-actions {
            display: flex;
            gap: 16px;
        }
        .nav-btn {
            width: 32px;
            height: 32px;
            border-radius: 6px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #007aff;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .nav-btn:hover {
            background: #f2f2f7;
        }
        .webview-container {
            padding: 88px 0 0;
            height: calc(100vh - 88px);
            overflow: hidden;
        }
        .webview-frame {
            width: 100%;
            height: 100%;
            border: none;
        }
        .loading-overlay {
            position: fixed;
            top: 88px;
            left: 0;
            right: 0;
            bottom: 0;
            background: white;
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1500;
        }
        .spinner {
            width: 40px;
            height: 40px;
            border: 3px solid #f2f2f7;
            border-top: 3px solid #007aff;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        .auto-claim-panel {
            position: fixed;
            bottom: 20px;
            right: 20px;
            background: white;
            border-radius: 16px;
            padding: 16px;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
            z-index: 1000;
            display: flex;
            flex-direction: column;
            gap: 12px;
            min-width: 200px;
        }
        .panel-header {
            font-size: 16px;
            font-weight: 600;
            color: #1d1d1f;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .panel-btn {
            padding: 12px;
            border-radius: 12px;
            font-weight: 600;
            text-align: center;
            cursor: pointer;
            border: none;
            transition: all 0.2s ease;
        }
        .btn-primary {
            background: #007aff;
            color: white;
        }
        .btn-primary:hover {
            background: #0056d6;
        }
        .btn-secondary {
            background: #f2f2f7;
            color: #1d1d1f;
        }
        .btn-secondary:hover {
            background: #e5e5ea;
        }
        .status-indicator {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            color: #8e8e93;
        }
        .status-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: #34c759;
        }
        .status-dot.offline {
            background: #ff3b30;
        }
    </style>
</head>
<body>
    <!-- 状态栏 -->
    <div class="status-bar">
        <span>12:34</span>
        <span>📶 5G</span>
    </div>

    <!-- 导航栏 -->
    <div class="nav-bar">
        <div class="nav-title">黑色序章宿命回响</div>
        <div class="nav-actions">
            <div class="nav-btn" onclick="sharePage()">
                <i class="fas fa-share-alt"></i>
            </div>
            <div class="nav-btn" onclick="closeWebView()">
                <i class="fas fa-times"></i>
            </div>
        </div>
    </div>

    <!-- 网页容器 -->
    <div class="webview-container">
        <!-- 模拟网页内容 -->
        <div style="padding: 20px; background: white; min-height: 100%;">
            <!-- 网页头部 -->
            <div style="text-align: center; margin-bottom: 30px;">
                <img src="https://game.gtimg.cn/images/dnf/cp/a20250807index/header.jpg" 
                     alt="黑色序章宿命回响" style="width: 100%; max-width: 400px; border-radius: 12px;">
                <h1 style="font-size: 24px; font-weight: bold; margin: 20px 0; color: #1d1d1f;">
                    黑色序章宿命回响
                </h1>
                <p style="color: #8e8e93; margin-bottom: 30px;">
                    活动时间: 2025-08-28 至 2025-09-25
                </p>
            </div>

            <!-- 登录状态 -->
            <div style="background: #f0f7ff; padding: 16px; border-radius: 12px; margin-bottom: 30px; border-left: 4px solid #007aff;">
                <div style="display: flex; align-items: center; gap: 12px;">
                    <i class="fas fa-check-circle" style="color: #34c759; font-size: 20px;"></i>
                    <div>
                        <div style="font-weight: 600; color: #1d1d1f;">已登录</div>
                        <div style="font-size: 14px; color: #8e8e93;">当前盒子: 主号盒子</div>
                    </div>
                </div>
            </div>

            <!-- 福利内容 -->
            <div style="margin-bottom: 30px;">
                <h2 style="font-size: 20px; font-weight: 600; margin-bottom: 20px; color: #1d1d1f;">
                    每日登录福利
                </h2>
                
                <div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px; margin-bottom: 30px;">
                    <div style="background: white; border: 2px solid #e5e5ea; border-radius: 12px; padding: 16px; text-align: center;">
                        <div style="font-size: 14px; color: #8e8e93; margin-bottom: 8px;">第1天</div>
                        <div style="font-weight: 600; color: #1d1d1f; margin-bottom: 8px;">王者契约礼包</div>
                        <button style="background: #007aff; color: white; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; width: 100%;"
                                onclick="claimReward('王者契约礼包')">
                            领取
                        </button>
                    </div>
                    
                    <div style="background: white; border: 2px solid #e5e5ea; border-radius: 12px; padding: 16px; text-align: center;">
                        <div style="font-size: 14px; color: #8e8e93; margin-bottom: 8px;">第3天</div>
                        <div style="font-weight: 600; color: #1d1d1f; margin-bottom: 8px;">装备提升礼盒</div>
                        <button style="background: #007aff; color: white; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; width: 100%;"
                                onclick="claimReward('装备提升礼盒')">
                            领取
                        </button>
                    </div>
                    
                    <div style="background: white; border: 2px solid #34c759; border-radius: 12px; padding: 16px; text-align: center; position: relative;">
                        <div style="position: absolute; top: -8px; right: -8px; background: #34c759; color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 12px;">
                            <i class="fas fa-check"></i>
                        </div>
                        <div style="font-size: 14px; color: #8e8e93; margin-bottom: 8px;">第7天</div>
                        <div style="font-weight: 600; color: #1d1d1f; margin-bottom: 8px;">灵魂武器自选礼盒</div>
                        <div style="font-size: 12px; color: #34c759; font-weight: 600;">已领取</div>
                    </div>
                </div>
            </div>

            <!-- 任务区域 -->
            <div>
                <h2 style="font-size: 20px; font-weight: 600; margin-bottom: 20px; color: #1d1d1f;">
                    每日任务
                </h2>
                
                <div style="background: white; border: 1px solid #e5e5ea; border-radius: 12px; padding: 16px; margin-bottom: 16px;">
                    <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
                        <div style="font-weight: 600; color: #1d1d1f;">通关深渊：终末崇拜者8次</div>
                        <div style="background: #007aff; color: white; padding: 4px 8px; border-radius: 12px; font-size: 12px;">
                            1次抽奖
                        </div>
                    </div>
                    <div style="color: #8e8e93; margin-bottom: 12px; font-size: 14px;">
                        活动期间，首次完成任务可额外获得道具奖励
                    </div>
                    <div style="display: flex; gap: 8px;">
                        <button style="background: #007aff; color: white; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; flex: 1;"
                                onclick="completeTask('通关深渊')">
                            完成任务
                        </button>
                        <button style="background: #f2f2f7; color: #1d1d1f; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; flex: 1;"
                                onclick="viewDetails('通关深渊')">
                            查看详情
                        </button>
                    </div>
                </div>

                <div style="background: white; border: 1px solid #e5e5ea; border-radius: 12px; padding: 16px;">
                    <div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;">
                        <div style="font-weight: 600; color: #1d1d1f;">累计在线时长超30分钟</div>
                        <div style="background: #007aff; color: white; padding: 4px 8px; border-radius: 12px; font-size: 12px;">
                            1次抽奖
                        </div>
                    </div>
                    <div style="color: #8e8e93; margin-bottom: 12px; font-size: 14px;">
                        活动期间，首次完成任务可额外获得道具奖励
                    </div>
                    <div style="display: flex; gap: 8px;">
                        <button style="background: #007aff; color: white; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; flex: 1;"
                                onclick="completeTask('在线时长')">
                            完成任务
                        </button>
                        <button style="background: #f2f2f7; color: #1d1d1f; border: none; padding: 8px 16px; border-radius: 8px; font-weight: 600; cursor: pointer; flex: 1;"
                                onclick="viewDetails('在线时长')">
                            查看详情
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 自动领取面板 -->
    <div class="auto-claim-panel">
        <div class="panel-header">
            <i class="fas fa-robot"></i>
            <span>自动操作</span>
        </div>
        <div class="status-indicator">
            <div class="status-dot"></div>
            <span>已就绪</span>
        </div>
        <button class="panel-btn btn-primary" onclick="autoClaimAll()">
            <i class="fas fa-bolt"></i> 一键领取全部
        </button>
        <button class="panel-btn btn-secondary" onclick="simulateLogin()">
            <i class="fas fa-sign-in-alt"></i> 模拟QQ登录
        </button>
    </div>

    <script>
        function sharePage() {
            alert('分享功能: 将当前页面分享到其他平台');
        }

        function closeWebView() {
            alert('关闭网页视图，返回主界面');
        }

        function claimReward(rewardName) {
            alert(`领取奖励: ${rewardName}`);
            // 这里会执行实际的领取逻辑
        }

        function completeTask(taskName) {
            alert(`完成任务: ${taskName}`);
            // 这里会执行实际的任务完成逻辑
        }

        function viewDetails(itemName) {
            alert(`查看详情: ${itemName}`);
        }

        function autoClaimAll() {
            alert('开始自动领取所有可领取的奖励...');
            // 这里会执行自动领取脚本
            simulateAutoClaimProcess();
        }

        function simulateLogin() {
            alert('模拟QQ一键登录流程...');
            // 这里会执行QQ登录逻辑
        }

        function simulateAutoClaimProcess() {
            // 模拟自动领取过程
            const panel = document.querySelector('.auto-claim-panel');
            const status = panel.querySelector('.status-indicator');
            const dot = panel.querySelector('.status-dot');
            const text = panel.querySelector('.status-indicator span');
            const btn = panel.querySelector('.btn-primary');
            
            btn.disabled = true;
            text.textContent = '领取中...';
            dot.classList.add('offline');
            
            setTimeout(() => {
                text.textContent = '领取完成';
                dot.classList.remove('offline');
                btn.disabled = false;
                
                // 显示领取结果
                alert('自动领取完成！\n成功领取: 3个奖励\n失败: 0个');
            }, 2000);
        }

        // 模拟页面加载
        setTimeout(() => {
            document.querySelector('.loading-overlay')?.remove();
        }, 1000);
    </script>

    <!-- 加载遮罩 -->
    <div class="loading-overlay">
        <div class="spinner"></div>
    </div>
</body>
</html>